package com.mpsc.singleton.demo.controller;

import com.mpsc.singleton.demo.service.AsyncService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/async")
@Api(value = "AsyncController", tags = "异步测试")
public class AsyncController {

    @Autowired
    private AsyncService asyncService;

    @GetMapping("/test")
    @ApiOperation("测试异步执行")
    public void asyncTest() {
        //测试spring事务问题
        asyncService.asyncTest();
    }
}
